package com.lantu.core.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lantu.core.entity.User;
import com.lantu.dto.member.MemberDTO;
import com.lantu.core.entity.Member;
import com.lantu.dto.member.MemberLoginDTO;
import com.lantu.dto.member.MemberPageDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author binyuhuang
 * @since 2023-02-07
 */
public interface IMemberService extends IService<Member> {
    Map<String, Object> login(HttpServletRequest request, MemberLoginDTO dto) throws Exception;

    Map<String, Object> getUserInfo(String token);

    void logout(String token);

    boolean addMember(User loginUser, MemberDTO dto);

    boolean updateMember(User loginUser, MemberDTO dto);


    /**
     * 根据用户名查找会员
     * @param username 用户名
     * */
    Member getMemberByUsername(String username);

    /**
     * 获取分页数据
     * */
    Page<Member> getMemberPage(MemberPageDTO dto);


}
